﻿namespace UnityEditor
{
    using System;
    using UnityEngine;

    [Serializable]
    internal class AnimQuaternion : AnimValue
    {
        [SerializeField]
        private Quaternion m_Value;

        public AnimQuaternion()
        {
            this.m_Value = Quaternion.identity;
        }

        public AnimQuaternion(Quaternion val)
        {
            this.m_Value = val;
        }

        public static implicit operator Quaternion(AnimQuaternion v)
        {
            return v.m_Value;
        }

        internal override void Update()
        {
            this.m_Value = Quaternion.Slerp((Quaternion) base.m_Source, this.target, base.smoothed);
        }

        public Quaternion target
        {
            get
            {
                return (Quaternion) base.GetTarget(this.m_Value);
            }
            set
            {
                if (value != this.m_Value)
                {
                    base.BeginAnimating(value, this.m_Value);
                }
            }
        }

        public Quaternion value
        {
            get
            {
                return this.m_Value;
            }
            set
            {
                this.m_Value = value;
                base.StopAnim(value);
            }
        }
    }
}

